<?php
namespace HelloWeb\UserBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UserForm extends AbstractType
{

    public function getName()
    {
        return 'userForm';
    }
    

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('firstName', 'text', array(
            'label'=>'First Name',
            'required'=>true,
            'data'=>'Here input first name',//init value
            'mapped'=>true //set to false, then firstName can't linked with table field.
        ))
            ->add('lastName', null, array(
            'label'=>'Last Name',
            'required'=>true
        ))
            ->add('save', 'submit');
    }
}
